﻿Public Class RproformaAdicional

    Public Shared Function Añadir(ByVal descEmpresa As String, ByVal pProformaAdicional As EproformaAdicional) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DproformaAdicional.Añadir(descEmpresa, pProformaAdicional)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function cargarAdicionales(ByVal descEmpresa As String, ByVal idProforma As Int32) As List(Of EproformaAdicional)
        Dim proformaAdicional As List(Of EproformaAdicional) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformaAdicional = DproformaAdicional.cargarAdicionales(descEmpresa, idProforma)
                If proformaAdicional Is Nothing Then proformaAdicional = New List(Of EproformaAdicional)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformaAdicional
    End Function

End Class
